package com.ocean.elasticSearch.entity;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * @version 1.0
 * @className: DocBean
 * @description: DocBean 实体类
 * @author: lxq
 * @date: 2021/4/15
 **/
@Data
@NoArgsConstructor
@Accessors(chain = true)
@Document(indexName = "ocean", shards = 1, replicas = 0)
public class DocBean implements Serializable {
    @Id
    private Long id;

    @Field(type = FieldType.Keyword)
    private String firstCode;

    @Field(type = FieldType.Keyword)
    private String secondCode;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String content;

    @Field(type = FieldType.Integer)
    private Integer type;

    public DocBean(Long id, String firstCode, String secordCode, String content, Integer type) {
        this.id = id;
        this.firstCode = firstCode;
        this.secondCode = secordCode;
        this.content = content;
        this.type = type;
    }
}


